package spec.ganlijuan.unit3.jdbc;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;

public class JdbcText {
    public static void main(String[] args) throws ClassNotFoundException, SQLException {
        String URL="jdbc:mysql://127.0.0.1:3306/dyf";
        String USER="root";
        String PASSWORD="13890950837";
        //1.加载驱动程序
        Class.forName("com.mysql.jdbc.Driver");
        //2.获得数据库连接
        Connection conn= DriverManager.getConnection(URL,USER,PASSWORD);
        System.out.println("JDBC连接Mysql成功");
        //3.操作数据库，实现增删改查
        Statement stmt=conn.createStatement();
        //增加3条
        String s1="INSERT INTO t_student values(1,'邓大','13400',18)";
        String s2="INSERT INTO t_student values(2,'王二','13401',18)";
        String s3="INSERT INTO t_student values(3,'李三','13402',18)";
    }
}
